package com.lucker.ds.model;

/**
 * cai_piao_error_code
 * @author 
 */
public class CaiPiaoErrorCode extends BaseValueObject {
    private Long id;

    /**
     * 渠道
     */
    private String channel;

    /**
     * 期号
     */
    private String issue;

    /**
     * CAI_ID
     */
    private String caiId;

    /**
     * 开奖号码
     */
    private String openCode;

    /**
     * 组ID 每一组代表同一个CAIID,同一期
     */
    private String groupId;

    /**
     * 是否最终是正确开奖号码
     */
    private String isCorrect;

    private String customQuerySqlText = null;

    private String orderStr = null;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getChannel() {
        return channel;
    }

    public void setChannel(String channel) {
        this.channel = channel;
    }

    public String getIssue() {
        return issue;
    }

    public void setIssue(String issue) {
        this.issue = issue;
    }

    public String getCaiId() {
        return caiId;
    }

    public void setCaiId(String caiId) {
        this.caiId = caiId;
    }

    public String getOpenCode() {
        return openCode;
    }

    public void setOpenCode(String openCode) {
        this.openCode = openCode;
    }

    public String getGroupId() {
        return groupId;
    }

    public void setGroupId(String groupId) {
        this.groupId = groupId;
    }

    public String getIsCorrect() {
        return isCorrect;
    }

    public void setIsCorrect(String isCorrect) {
        this.isCorrect = isCorrect;
    }

    public void setCustomQuerySqlText(String customQuerySqlText) {
        this.customQuerySqlText = customQuerySqlText;
    }

    public String getCustomQuerySqlText() {
        return customQuerySqlText;
    }

    public void orderById(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by id asc";
            }else{
                this.orderStr = this.orderStr + ",id asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by id desc";
            }else{
                this.orderStr = this.orderStr + ",id desc";
            }
        }
    }

    public void orderByChannel(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by channel asc";
            }else{
                this.orderStr = this.orderStr + ",channel asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by channel desc";
            }else{
                this.orderStr = this.orderStr + ",channel desc";
            }
        }
    }

    public void orderByIssue(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by issue asc";
            }else{
                this.orderStr = this.orderStr + ",issue asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by issue desc";
            }else{
                this.orderStr = this.orderStr + ",issue desc";
            }
        }
    }

    public void orderByCaiId(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by cai_id asc";
            }else{
                this.orderStr = this.orderStr + ",cai_id asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by cai_id desc";
            }else{
                this.orderStr = this.orderStr + ",cai_id desc";
            }
        }
    }

    public void orderByOpenCode(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by open_code asc";
            }else{
                this.orderStr = this.orderStr + ",open_code asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by open_code desc";
            }else{
                this.orderStr = this.orderStr + ",open_code desc";
            }
        }
    }

    public void orderByGroupId(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by group_id asc";
            }else{
                this.orderStr = this.orderStr + ",group_id asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by group_id desc";
            }else{
                this.orderStr = this.orderStr + ",group_id desc";
            }
        }
    }

    public void orderByIsCorrect(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by is_correct asc";
            }else{
                this.orderStr = this.orderStr + ",is_correct asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by is_correct desc";
            }else{
                this.orderStr = this.orderStr + ",is_correct desc";
            }
        }
    }
}